package com.example.text8;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import androidx.appcompat.app.AppCompatActivity;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import butterknife.Unbinder;

public class MainActivity extends AppCompatActivity {
    @BindView(R.id.btn_video)
    Button btn_video;
    @BindView(R.id.btn_all)
    Button btn_all;

    private Unbinder unbinder;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        unbinder = ButterKnife.bind(MainActivity.this);
    }

    @Override
    protected void onDestroy() {
        if (unbinder != null) {
            unbinder.unbind();
        }

        super.onDestroy();
    }

    @OnClick({R.id.btn_video, R.id.btn_all})
    public void onClick(View view) {
        Intent intent;
        switch (view.getId()) {
            case R.id.btn_video:
                intent = new Intent(MainActivity.this, VideoFileActivity.class);
                startActivity(intent);
                break;
            case R.id.btn_all:
                intent = new Intent(MainActivity.this, AllVideoActivity.class);
                startActivity(intent);
                break;
        }
    }
}